/*
 * @Author: 余文童
 * @Date: 2020-08-10 10:53:10
 * @LastEditTime: 2020-08-13 12:05:04
 * @LastEditors: Please set LastEditors
 * @Description: 订单服务实现类
 * @FilePath: \BackEnd\saleflower\src\main\java\com\wangwang\saleflower\service\impl\OrderServiceImpl.java
 */
package com.wangwang.saleflower.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import com.wangwang.saleflower.entity.Order;
import com.wangwang.saleflower.mapper.OrderMapper;
import com.wangwang.saleflower.service.OrderService;

import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements OrderService {

    @Resource
    OrderMapper orderMapper;

    @Override
    public List<Order> getAllOrders(int userNum) {
        return orderMapper.selectAllOrder(userNum);
    }

    @Override
    public void removeOrders(Long[] listIds) {
        orderMapper.removeOrders(listIds);
    }

    @Override
    public void addOrder(Order order) {
        // TODO Auto-generated method stub
        orderMapper.addOrder(order);
    }

    @Override
    public List<Map<String, Object>> selectOrderAndProduct(Integer id) {
        return orderMapper.selectOrderAndProduct(id);
    }

    @Override
    public boolean isOrderExist(Long id) {
        return orderMapper.isOrderExist(id) > 0;
    }

}
